﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WatiN.Core;

namespace VisaPoint
{
    public class IEExtension : IE
    {
        private bool _IsClose = true;
        public IEExtension(string url)
            : base(url)
        {
            _IsClose = false;
        }
        public Boolean IsClose()
        {
            return _IsClose;
        }
        public override void Close()
        {
            _IsClose = true;
            base.Close();
        }
        public override Div Div(WatiN.Core.Constraints.Constraint findBy)
        {
            if (_IsClose)
            {
                throw new Exception("Browse Is Close");
            }
            return base.Div(findBy);
        }
        public override Button Button(WatiN.Core.Constraints.Constraint findBy)
        {
            if (_IsClose)
            {
                throw new Exception("Browse Is Close");
            }
            return base.Button(findBy);
        }
        public override TextField TextField(WatiN.Core.Constraints.Constraint findBy)
        {
            if (_IsClose)
            {
                throw new Exception("Browse Is Close");
            }
            return base.TextField(findBy);
        }
    }
}
